<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>chigraph: lib/core/src/JsonSerializer.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="chigraphDoxygenIcon.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">chigraph
   &#160;<span id="projectnumber">master</span>
   </div>
   <div id="projectbrief">Systems programming language written for beginners in LLVM</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('JsonSerializer_8cpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">JsonSerializer.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="JsonSerializer_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="JsonSerializer_8hpp.html">chi/JsonSerializer.hpp</a>&quot;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="DataType_8hpp.html">chi/DataType.hpp</a>&quot;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="GraphFunction_8hpp.html">chi/GraphFunction.hpp</a>&quot;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="GraphModule_8hpp.html">chi/GraphModule.hpp</a>&quot;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="GraphStruct_8hpp.html">chi/GraphStruct.hpp</a>&quot;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="NodeInstance_8hpp.html">chi/NodeInstance.hpp</a>&quot;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="NodeType_8hpp.html">chi/NodeType.hpp</a>&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;boost/uuid/uuid_io.hpp&gt;</span>  <span class="comment">// for boost::uuids::to_string</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacechi.html">chi</a> {</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="namespacechi.html#afd8b8d8a207d88359ad1e6a48d8f3bb1">   15</a></span>&#160;nlohmann::json <a class="code" href="namespacechi.html#afd8b8d8a207d88359ad1e6a48d8f3bb1">graphFunctionToJson</a>(<span class="keyword">const</span> <a class="code" href="structchi_1_1GraphFunction.html">GraphFunction</a>&amp; func) {</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    <span class="keyword">auto</span> jsonData = nlohmann::json{};</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    jsonData[<span class="stringliteral">&quot;type&quot;</span>]        = <span class="stringliteral">&quot;function&quot;</span>;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    jsonData[<span class="stringliteral">&quot;name&quot;</span>]        = func.<a class="code" href="structchi_1_1GraphFunction.html#a89069f6e08f71cfbafb245ea16c8d69f">name</a>();</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    jsonData[<span class="stringliteral">&quot;description&quot;</span>] = func.<a class="code" href="structchi_1_1GraphFunction.html#ad261ccd66a6fcbf6492cf6565e365d0e">description</a>();</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <span class="keyword">auto</span>&amp; datainputsjson = jsonData[<span class="stringliteral">&quot;data_inputs&quot;</span>];</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    datainputsjson       = nlohmann::json::array();</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; in : func.<a class="code" href="structchi_1_1GraphFunction.html#ab457f58fbb96c8089340b4ebd43cb633">dataInputs</a>()) {</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        datainputsjson.push_back({{in.name, in.type.qualifiedName()}});</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    }</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="comment">// serialize the local variables</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <span class="keyword">auto</span>&amp; localsjson = jsonData[<span class="stringliteral">&quot;local_variables&quot;</span>];</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    localsjson       = nlohmann::json::object();</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; local : func.<a class="code" href="structchi_1_1GraphFunction.html#a44f8f791775e4878b6bde37140cd131d">localVariables</a>()) {</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        localsjson[local.name] = local.type.qualifiedName();</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    }</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <span class="keyword">auto</span>&amp; dataoutputsjson = jsonData[<span class="stringliteral">&quot;data_outputs&quot;</span>];</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    dataoutputsjson       = nlohmann::json::array();</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; out : func.<a class="code" href="structchi_1_1GraphFunction.html#ab0bf0d819ff062c01220614f617d5965">dataOutputs</a>()) {</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        dataoutputsjson.push_back({{out.name, out.type.qualifiedName()}});</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    }</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keyword">auto</span>&amp; execinputsjson = jsonData[<span class="stringliteral">&quot;exec_inputs&quot;</span>];</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    execinputsjson       = nlohmann::json::array();</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; in : func.<a class="code" href="structchi_1_1GraphFunction.html#a64fa4eceaf024d3ebf628fe15e7ca9be">execInputs</a>()) { execinputsjson.push_back(in); }</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keyword">auto</span>&amp; execoutputsjson = jsonData[<span class="stringliteral">&quot;exec_outputs&quot;</span>];</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    execoutputsjson       = nlohmann::json::array();</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; out : func.<a class="code" href="structchi_1_1GraphFunction.html#ab47bbbd84f14240b824c1a780b125207">execOutputs</a>()) { execoutputsjson.push_back(out); }</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="comment">// serialize the nodes</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keyword">auto</span>&amp; jsonNodes = jsonData[<span class="stringliteral">&quot;nodes&quot;</span>];</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    jsonNodes       = nlohmann::json::object();  <span class="comment">// make sure even if it&#39;s empty it&#39;s an object</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keyword">auto</span>&amp; jsonConnections = jsonData[<span class="stringliteral">&quot;connections&quot;</span>];</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    jsonConnections       = nlohmann::json::array();  <span class="comment">// make sure even if it&#39;s empty it&#39;s an aray</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; nodepair : func.<a class="code" href="structchi_1_1GraphFunction.html#aa5985d96d7564d7ee7f240fdb02b41a6">nodes</a>()) {</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <span class="keyword">auto</span>&amp;       node   = nodepair.second;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        std::string nodeID = boost::uuids::to_string(nodepair.first);</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        nlohmann::json nodeJson = node-&gt;type().toJSON();</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        jsonNodes[nodeID]       = {{<span class="stringliteral">&quot;type&quot;</span>, node-&gt;type().qualifiedName()},</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                             {<span class="stringliteral">&quot;location&quot;</span>, {node-&gt;x(), node-&gt;y()}},</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;                             {<span class="stringliteral">&quot;data&quot;</span>, nodeJson}};</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        <span class="comment">// add its connections. Just out the outputs to avoid duplicates</span></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <span class="comment">// add the exec outputs</span></div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <span class="keywordflow">for</span> (<span class="keyword">auto</span> conn_id = 0ull; conn_id &lt; node-&gt;outputExecConnections.size(); ++conn_id) {</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            <span class="keyword">auto</span>&amp; conn = node-&gt;outputExecConnections[conn_id];</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            <span class="comment">// if there is actually a connection</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            <span class="keywordflow">if</span> (conn.first != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                jsonConnections.push_back(</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                    {{<span class="stringliteral">&quot;type&quot;</span>, <span class="stringliteral">&quot;exec&quot;</span>},</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                     {<span class="stringliteral">&quot;input&quot;</span>, {nodeID, conn_id}},</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                     {<span class="stringliteral">&quot;output&quot;</span>, {boost::uuids::to_string(conn.first-&gt;id()), conn.second}}});</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            }</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        }</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="comment">// add the data outputs</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="keywordflow">for</span> (<span class="keyword">auto</span> conn_id = 0ull; conn_id &lt; node-&gt;inputDataConnections.size(); ++conn_id) {</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            <span class="comment">// if there is actually a connection</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;            <span class="keyword">auto</span>&amp; connpair = node-&gt;inputDataConnections[conn_id];</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;            <span class="keywordflow">if</span> (connpair.first != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                jsonConnections.push_back(</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                    {{<span class="stringliteral">&quot;type&quot;</span>, <span class="stringliteral">&quot;data&quot;</span>},</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;                     {<span class="stringliteral">&quot;input&quot;</span>, {boost::uuids::to_string(connpair.first-&gt;id()), connpair.second}},</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;                     {<span class="stringliteral">&quot;output&quot;</span>, {nodeID, conn_id}}});</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;            }</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        }</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    }</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordflow">return</span> jsonData;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;}</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="namespacechi.html#a9a4f3fa54c612f0c559a353bb7382d5a">   97</a></span>&#160;nlohmann::json <a class="code" href="namespacechi.html#a9a4f3fa54c612f0c559a353bb7382d5a">graphModuleToJson</a>(<span class="keyword">const</span> <a class="code" href="structchi_1_1GraphModule.html">GraphModule</a>&amp; mod) {</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    nlohmann::json data;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="keyword">auto</span>&amp; depsjson = data[<span class="stringliteral">&quot;dependencies&quot;</span>];</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    depsjson       = nlohmann::json::array();</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; dep : mod.<a class="code" href="structchi_1_1ChiModule.html#a9c0d4b1b54bca0194ea4061ae4883779">dependencies</a>()) { depsjson.push_back(dep.generic_string()); }</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keyword">auto</span>&amp; graphsjson = data[<span class="stringliteral">&quot;graphs&quot;</span>];</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    graphsjson       = nlohmann::json::array();</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; graph : mod.<a class="code" href="structchi_1_1GraphModule.html#a45255dbf09b56ac93b35ebc4d77bba5c">functions</a>()) { graphsjson.push_back(<a class="code" href="namespacechi.html#afd8b8d8a207d88359ad1e6a48d8f3bb1">graphFunctionToJson</a>(*graph)); }</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keyword">auto</span>&amp; structsJson = data[<span class="stringliteral">&quot;types&quot;</span>];</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    structsJson       = nlohmann::json::object();</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; str : mod.structs()) { structsJson[str-&gt;name()] = <a class="code" href="namespacechi.html#af74872167b12e4ad8a387faab1f03fbb">graphStructToJson</a>(*str); }</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    data[<span class="stringliteral">&quot;has_c_support&quot;</span>] = mod.<a class="code" href="structchi_1_1GraphModule.html#ac251cc6b4242642f6601c8c3607f5747">cEnabled</a>();</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="keywordflow">return</span> data;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;}</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="namespacechi.html#af74872167b12e4ad8a387faab1f03fbb">  117</a></span>&#160;nlohmann::json <a class="code" href="namespacechi.html#af74872167b12e4ad8a387faab1f03fbb">graphStructToJson</a>(<span class="keyword">const</span> <a class="code" href="structchi_1_1GraphStruct.html">GraphStruct</a>&amp; struc) {</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    nlohmann::json ret = nlohmann::json::array();</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; elem : struc.<a class="code" href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">types</a>()) {</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        ret.push_back({{elem.name, elem.type.qualifiedName()}});</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    }</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keywordflow">return</span> ret;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;}</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;}  <span class="comment">// namespace chi</span></div><div class="ttc" id="namespacechi_html_afd8b8d8a207d88359ad1e6a48d8f3bb1"><div class="ttname"><a href="namespacechi.html#afd8b8d8a207d88359ad1e6a48d8f3bb1">chi::graphFunctionToJson</a></div><div class="ttdeci">nlohmann::json graphFunctionToJson(const GraphFunction &amp;func)</div><div class="ttdoc">Serialize a GraphFunction to json. </div><div class="ttdef"><b>Definition:</b> <a href="JsonSerializer_8cpp_source.html#l00015">JsonSerializer.cpp:15</a></div></div>
<div class="ttc" id="JsonSerializer_8hpp_html"><div class="ttname"><a href="JsonSerializer_8hpp.html">JsonSerializer.hpp</a></div><div class="ttdoc">Define json serialization functions. </div></div>
<div class="ttc" id="structchi_1_1GraphFunction_html_ab0bf0d819ff062c01220614f617d5965"><div class="ttname"><a href="structchi_1_1GraphFunction.html#ab0bf0d819ff062c01220614f617d5965">chi::GraphFunction::dataOutputs</a></div><div class="ttdeci">const std::vector&lt; NamedDataType &gt; &amp; dataOutputs() const</div><div class="ttdoc">Get the function data outputs in the format {type, docstring}. </div><div class="ttdef"><b>Definition:</b> <a href="GraphFunction_8hpp_source.html#l00180">GraphFunction.hpp:180</a></div></div>
<div class="ttc" id="structchi_1_1GraphFunction_html"><div class="ttname"><a href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></div><div class="ttdoc">this is an AST-like representation of a function in a graph It is used for IDE-like behavior...</div><div class="ttdef"><b>Definition:</b> <a href="GraphFunction_8hpp_source.html#l00023">GraphFunction.hpp:23</a></div></div>
<div class="ttc" id="structchi_1_1GraphFunction_html_a64fa4eceaf024d3ebf628fe15e7ca9be"><div class="ttname"><a href="structchi_1_1GraphFunction.html#a64fa4eceaf024d3ebf628fe15e7ca9be">chi::GraphFunction::execInputs</a></div><div class="ttdeci">const std::vector&lt; std::string &gt; &amp; execInputs() const</div><div class="ttdoc">Get the function exec inputs. </div><div class="ttdef"><b>Definition:</b> <a href="GraphFunction_8hpp_source.html#l00216">GraphFunction.hpp:216</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html"><div class="ttname"><a href="structchi_1_1GraphStruct.html">chi::GraphStruct</a></div><div class="ttdoc">A class holding a compound type defined in a GraphModule. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00018">GraphStruct.hpp:18</a></div></div>
<div class="ttc" id="structchi_1_1GraphFunction_html_ab47bbbd84f14240b824c1a780b125207"><div class="ttname"><a href="structchi_1_1GraphFunction.html#ab47bbbd84f14240b824c1a780b125207">chi::GraphFunction::execOutputs</a></div><div class="ttdeci">const std::vector&lt; std::string &gt; &amp; execOutputs() const</div><div class="ttdoc">Get the function exec outputs. </div><div class="ttdef"><b>Definition:</b> <a href="GraphFunction_8hpp_source.html#l00241">GraphFunction.hpp:241</a></div></div>
<div class="ttc" id="structchi_1_1GraphModule_html_a45255dbf09b56ac93b35ebc4d77bba5c"><div class="ttname"><a href="structchi_1_1GraphModule.html#a45255dbf09b56ac93b35ebc4d77bba5c">chi::GraphModule::functions</a></div><div class="ttdeci">const std::vector&lt; std::unique_ptr&lt; GraphFunction &gt; &gt; &amp; functions() const</div><div class="ttdoc">Get functions. </div><div class="ttdef"><b>Definition:</b> <a href="GraphModule_8hpp_source.html#l00095">GraphModule.hpp:95</a></div></div>
<div class="ttc" id="GraphStruct_8hpp_html"><div class="ttname"><a href="GraphStruct_8hpp.html">GraphStruct.hpp</a></div><div class="ttdoc">Define GraphStruct. </div></div>
<div class="ttc" id="structchi_1_1GraphFunction_html_a89069f6e08f71cfbafb245ea16c8d69f"><div class="ttname"><a href="structchi_1_1GraphFunction.html#a89069f6e08f71cfbafb245ea16c8d69f">chi::GraphFunction::name</a></div><div class="ttdeci">std::string name() const</div><div class="ttdoc">Get the name of the function. </div><div class="ttdef"><b>Definition:</b> <a href="GraphFunction_8hpp_source.html#l00313">GraphFunction.hpp:313</a></div></div>
<div class="ttc" id="namespacechi_html_af74872167b12e4ad8a387faab1f03fbb"><div class="ttname"><a href="namespacechi.html#af74872167b12e4ad8a387faab1f03fbb">chi::graphStructToJson</a></div><div class="ttdeci">nlohmann::json graphStructToJson(const GraphStruct &amp;struc)</div><div class="ttdoc">Serialize a GraphStruct to json. </div><div class="ttdef"><b>Definition:</b> <a href="JsonSerializer_8cpp_source.html#l00117">JsonSerializer.cpp:117</a></div></div>
<div class="ttc" id="structchi_1_1GraphModule_html_ac251cc6b4242642f6601c8c3607f5747"><div class="ttname"><a href="structchi_1_1GraphModule.html#ac251cc6b4242642f6601c8c3607f5747">chi::GraphModule::cEnabled</a></div><div class="ttdeci">bool cEnabled() const</div><div class="ttdoc">Gets if C support is enabled. </div><div class="ttdef"><b>Definition:</b> <a href="GraphModule_8hpp_source.html#l00136">GraphModule.hpp:136</a></div></div>
<div class="ttc" id="structchi_1_1GraphFunction_html_aa5985d96d7564d7ee7f240fdb02b41a6"><div class="ttname"><a href="structchi_1_1GraphFunction.html#aa5985d96d7564d7ee7f240fdb02b41a6">chi::GraphFunction::nodes</a></div><div class="ttdeci">std::unordered_map&lt; boost::uuids::uuid, std::unique_ptr&lt; NodeInstance &gt; &gt; &amp; nodes()</div><div class="ttdoc">Get the nodes in the function Usually called by connectData or connectExec or GraphFunction. </div><div class="ttdef"><b>Definition:</b> <a href="GraphFunction_8hpp_source.html#l00051">GraphFunction.hpp:51</a></div></div>
<div class="ttc" id="NodeType_8hpp_html"><div class="ttname"><a href="NodeType_8hpp.html">NodeType.hpp</a></div><div class="ttdoc">Defines the NodeType class. </div></div>
<div class="ttc" id="namespacechi_html_a9a4f3fa54c612f0c559a353bb7382d5a"><div class="ttname"><a href="namespacechi.html#a9a4f3fa54c612f0c559a353bb7382d5a">chi::graphModuleToJson</a></div><div class="ttdeci">nlohmann::json graphModuleToJson(const GraphModule &amp;mod)</div><div class="ttdoc">Serialize a JsonModule to json. </div><div class="ttdef"><b>Definition:</b> <a href="JsonSerializer_8cpp_source.html#l00097">JsonSerializer.cpp:97</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_ae1895cfaebac03e21d35ec2a155b3c10"><div class="ttname"><a href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">chi::GraphStruct::types</a></div><div class="ttdeci">const std::vector&lt; NamedDataType &gt; &amp; types() const</div><div class="ttdoc">Get the types the struct contains. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00047">GraphStruct.hpp:47</a></div></div>
<div class="ttc" id="structchi_1_1ChiModule_html_a9c0d4b1b54bca0194ea4061ae4883779"><div class="ttname"><a href="structchi_1_1ChiModule.html#a9c0d4b1b54bca0194ea4061ae4883779">chi::ChiModule::dependencies</a></div><div class="ttdeci">const std::set&lt; boost::filesystem::path &gt; &amp; dependencies() const</div><div class="ttdoc">Get the dependencies. </div><div class="ttdef"><b>Definition:</b> <a href="ChiModule_8hpp_source.html#l00083">ChiModule.hpp:83</a></div></div>
<div class="ttc" id="DataType_8hpp_html"><div class="ttname"><a href="DataType_8hpp.html">DataType.hpp</a></div><div class="ttdoc">Defines the DataType class. </div></div>
<div class="ttc" id="structchi_1_1GraphFunction_html_a44f8f791775e4878b6bde37140cd131d"><div class="ttname"><a href="structchi_1_1GraphFunction.html#a44f8f791775e4878b6bde37140cd131d">chi::GraphFunction::localVariables</a></div><div class="ttdeci">const std::vector&lt; NamedDataType &gt; &amp; localVariables() const</div><div class="ttdoc">Get the local variables. </div><div class="ttdef"><b>Definition:</b> <a href="GraphFunction_8hpp_source.html#l00265">GraphFunction.hpp:265</a></div></div>
<div class="ttc" id="structchi_1_1GraphModule_html"><div class="ttname"><a href="structchi_1_1GraphModule.html">chi::GraphModule</a></div><div class="ttdoc">Module that holds graph functions. </div><div class="ttdef"><b>Definition:</b> <a href="GraphModule_8hpp_source.html#l00016">GraphModule.hpp:16</a></div></div>
<div class="ttc" id="GraphModule_8hpp_html"><div class="ttname"><a href="GraphModule_8hpp.html">GraphModule.hpp</a></div><div class="ttdoc">Defines the GraphModule class. </div></div>
<div class="ttc" id="namespacechi_html"><div class="ttname"><a href="namespacechi.html">chi</a></div><div class="ttdoc">The namespace where chigraph lives. </div><div class="ttdef"><b>Definition:</b> <a href="BitcodeParser_8hpp_source.html#l00012">BitcodeParser.hpp:12</a></div></div>
<div class="ttc" id="structchi_1_1GraphFunction_html_ab457f58fbb96c8089340b4ebd43cb633"><div class="ttname"><a href="structchi_1_1GraphFunction.html#ab457f58fbb96c8089340b4ebd43cb633">chi::GraphFunction::dataInputs</a></div><div class="ttdeci">const std::vector&lt; NamedDataType &gt; &amp; dataInputs() const</div><div class="ttdoc">Get the function data inputs in the format {type, docstring}. </div><div class="ttdef"><b>Definition:</b> <a href="GraphFunction_8hpp_source.html#l00145">GraphFunction.hpp:145</a></div></div>
<div class="ttc" id="GraphFunction_8hpp_html"><div class="ttname"><a href="GraphFunction_8hpp.html">GraphFunction.hpp</a></div><div class="ttdoc">Declares the GraphFunction class. </div></div>
<div class="ttc" id="NodeInstance_8hpp_html"><div class="ttname"><a href="NodeInstance_8hpp.html">NodeInstance.hpp</a></div><div class="ttdoc">Defines the NodeInstance class and related functions. </div></div>
<div class="ttc" id="structchi_1_1GraphFunction_html_ad261ccd66a6fcbf6492cf6565e365d0e"><div class="ttname"><a href="structchi_1_1GraphFunction.html#ad261ccd66a6fcbf6492cf6565e365d0e">chi::GraphFunction::description</a></div><div class="ttdeci">const std::string &amp; description() const</div><div class="ttdoc">Get the description of the function. </div><div class="ttdef"><b>Definition:</b> <a href="GraphFunction_8hpp_source.html#l00303">GraphFunction.hpp:303</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_a2d5e495f4b604d04f57d90095a59dd6.html">core</a></li><li class="navelem"><a class="el" href="dir_4c9f1e14e2f6af37c0cac7b6ff4842b3.html">src</a></li><li class="navelem"><a class="el" href="JsonSerializer_8cpp.html">JsonSerializer.cpp</a></li>
    <li class="footer">Generated on Sat Sep 16 2017 17:41:35 for chigraph by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
